export const constRoutes = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录',
      hidden: true,
    },
  },
  // {
  //   name: 'guide',
  //   path: '/guide',
  //   component: () => import('@/views/guide/index.vue'),
  //   meta: {
  //     title: '引导页',
  //     hidden: true,
  //   },
  // },
  {
    name: 'layout',
    path: '/',
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    meta: {
      title: '',
      hidden: true,
    },
    children: [
      {
        name: 'home',
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        name: 'contract',
        path: '/contract',
        component: () => import('@/views/contract/index.vue'),
        meta: {
          title: '联系我们',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        name: 'about',
        path: '/about',
        component: () => import('@/views/about/index.vue'),
        meta: {
          title: '关于我们',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/boats/list',
        component: () => import('@/views/boats/index.vue'),
        meta: {
          title: 'detail',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/boats/brands',
        component: () => import('@/views/boats/brands/index.vue'),
        meta: {
          title: 'detail',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/boats/detail',
        component: () => import('@/views/boats/detail/index.vue'),
        meta: {
          title: 'detail',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/news',
        component: () => import('@/views/news/index.vue'),
        meta: {
          title: 'news',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/news/detail',
        component: () => import('@/views/news/detail/index.vue'),
        meta: {
          title: 'news',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/care',
        component: () => import('@/views/care/index.vue'),
        meta: {
          title: 'care',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
      {
        path: '/service',
        component: () => import('@/views/service/index.vue'),
        meta: {
          title: 'service',
          icon: 'HomeFilled',
          i18nKey: 'menu.home',
        },
      },
    ],
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
  // {
  //   path: '/screen',
  //   component: () => import('@/views/screen/index.vue'),
  //   name: 'Screen',
  //   meta: {
  //     hidden: false,
  //     title: '数据大屏',
  //     icon: 'Platform',
  //   },
  // },
]

const business = [
  {
    path: '/boat',
    component: () => import('@/layout/index.vue'),
    name: 'boat',
    meta: {
      title: '船艇信息管理',
      icon: 'Guide',
      i18nKey: 'menu.boat',
    },
    redirect: '/boat/basic',
    children: [
      {
        path: '/boat/basic',
        component: () => import('@/views/boat/basic/index.vue'),
        name: 'basic',
        meta: {
          title: '船艇基础信息管理',
          i18nKey: 'menu.basic',
        },
      },
      {
        path: '/boat/sale',
        component: () => import('@/views/boat/sale/index.vue'),
        name: 'sale',
        meta: {
          title: '销售信息管理',
          i18nKey: 'menu.sale',
        },
      },
      {
        path: '/boat/resource',
        component: () => import('@/views/boat/resource/index.vue'),
        name: 'resource',
        meta: {
          title: '船艇信息溯源',
          i18nKey: 'menu.resource',
        },
      },
      {
        path: '/boat/repaire',
        component: () => import('@/views/boat/repaire/index.vue'),
        name: 'repaire',
        meta: {
          title: '维护保养信息管理',
          i18nKey: 'menu.repaire',
        },
      },
      {
        path: '/boat/brand',
        component: () => import('@/views/boat/brand/index.vue'),
        name: 'brand',
        meta: {
          title: '品牌信息管理',
          i18nKey: 'menu.brand',
        },
      },
      {
        path: '/boat/type',
        component: () => import('@/views/boat/type/index.vue'),
        name: 'type',
        meta: {
          title: '船艇分类管理',
          i18nKey: 'menu.type',
        },
      },
      {
        path: '/boat/album',
        component: () => import('@/views/boat/album/index.vue'),
        name: 'album',
        meta: {
          title: '船艇相册管理',
          i18nKey: 'menu.album',
        },
      },
    ],
  },
  {
    path: '/website',
    component: () => import('@/layout/index.vue'),
    name: 'website',
    meta: {
      title: '网站管理',
      icon: 'Monitor',
      i18nKey: 'menu.website',
    },
    redirect: '/website/advise',
    children: [
      {
        path: '/website/advise',
        component: () => import('@/views/website/advise/index.vue'),
        name: 'advise',
        meta: {
          title: '推荐船艇设置',
          i18nKey: 'menu.advise',
        },
      },
      {
        path: '/website/publish',
        component: () => import('@/views/website/publish/index.vue'),
        name: 'publish',
        meta: {
          title: '信息发布设置',
          i18nKey: 'menu.publish',
        },
      },
    ]
  },
  {
    path: '/analysis',
    component: () => import('@/layout/index.vue'),
    name: 'analysis',
    meta: {
      title: '统计分析',
      icon: 'Lock',
      i18nKey: 'menu.analysis',
    },
    redirect: '/analysis/advice',
    children: [
      {
        path: '/analysis/advice',
        component: () => import('@/views/analysis/advice/index.vue'),
        name: 'advice',
        meta: {
          title: '咨询信息统计',
          i18nKey: 'menu.advice',
        },
      },
    ]
  },
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '咨询信息管理',
      icon: 'Lock',
      hidden: true
    },
    redirect: '/seek',
    children: [
      {
        path: '/seek',
        component: () => import('@/views/seek/index.vue'),
        name: 'seek',
        meta: {
          title: '咨询信息管理',
          i18nKey: 'menu.seek',
        },
      },
    ]
  },
  {
    path: '/member',
    component: () => import('@/layout/index.vue'),
    name: 'member',
    meta: {
      title: '客户信息管理',
      icon: 'Lock',
      hidden: true
    },
    redirect: '/member/rule',
    children: [
      {
        path: '/member/rule',
        component: () => import('@/views/member/index.vue'),
        name: 'rule',
        meta: {
          title: '客户信息管理',
          i18nKey: 'menu.member',
        },
      },
    ]
  }
]

//异步路由
export const asnycRoute = [
  {
    path: '/sys',
    component: () => import('@/layout/index.vue'),
    name: 'Sys',
    meta: {
      title: '系统管理',
      icon: 'Lock',
      i18nKey: 'menu.sys',
    },
    redirect: '/sys/user',
    children: [
      {
        path: '/sys/setting',
        component: () => import('@/views/sys/setting/index.vue'),
        name: 'Setting',
        meta: {
          title: '系统设置',
          icon: 'Setting',
          i18nKey: 'menu.setting',
        },
      },
      {
        path: '/sys/user',
        component: () => import('@/views/sys/user/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          icon: 'User',
          i18nKey: 'menu.user',
        },
      },
      {
        path: '/sys/role',
        component: () => import('@/views/sys/role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          icon: 'UserFilled',
          i18nKey: 'menu.role',
        },
      },
      {
        path: '/sys/permission',
        component: () => import('@/views/sys/permission/index.vue'),
        name: 'Permission',
        meta: {
          title: '菜单管理',
          icon: 'Menu',
          i18nKey: 'menu.permission',
        },
      },
      {
        path: '/sys/log',
        component: () => import('@/views/sys/log/index.vue'),
        name: 'Log',
        meta: {
          title: '系统日志',
          icon: 'Monitor',
          i18nKey: 'menu.log',
        },
      },
    ],
  },
  {
    path: '/workflow',
    component: () => import('@/layout/index.vue'),
    name: 'Workflow',
    meta: {
      title: '工作流',
      icon: 'Lock',
    },
    redirect: '/workflow/nodeTree',
    children: [
      {
        path: '/workflow/nodeTree',
        component: () => import('@/views/workflow/design.vue'),
        name: 'NodeTree',
        meta: {
          title: '流程设计器',
          icon: 'Setting',
        },
      },
    ],
  },
  {
    path: '/center',
    component: () => import('@/views/center/index.vue'),
    name: 'Center',
    meta: {
      hidden: true,
      title: '个人中心',
      icon: 'Platform',
    },
  },
  ...business
]

//任意路由
export const anyRoute = {
  //任意路由
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'Any',
  meta: {
    title: '任意路由',
    hidden: true,
    icon: 'DataLine',
  },
}
